package com;

import com.go2.shipping.common.encrypt.AES;
import com.yuhang.demo.util.PostUtil;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.message.BasicNameValuePair;

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * @user yuhang
 * @desc
 * @since 2021/11/15
 */
public class LiveTest {

    private static String api = "http://localhost:8002";

    //nJI8Zn9iTxvH8Q7f6S3gVbU4ZzjK2gcDOkX5kjFTvoHTjLu+X0tTM0DjuStastWc
    static String token = "9dLNROEBOnouv/V/IH1IQIHPSUSbKiNCnZ10Hs+0SwYL3uZbXe18CXjWnBp3NCtS"; //"l8RbBakkzommTygkP1zDqIDYlGe00dPpymCuLPk5HQc/+ZCCxV3OBVrfoEpph4bB";
    static AES aes = new AES("2016.01_go2plus_chengdu_china");
    public static void main(String[] args) throws Exception {
        long a=System.currentTimeMillis();
//        String result =liveList();
        String result=liveViolationList();
//        String result=liveRoomList();
        System.out.println(result);
        System.out.println(System.currentTimeMillis()-a);
    }


    private static String liveViolationList() throws IOException {

        String url=api+"/api/back/liveViolationList";
        String json="{\"pageNo\":1,\n" +
                " \"supplierName\":20,\"userId\":\"1\"}";
        return PostUtil.httpPostBody(url,json);
    }

    private static String liveRoomList() throws IOException {

        String url=api+"/api/back/liveRoomList";
        String json="{\"pageNo\":1,\n" +
                " \"pageSize\":20,\"sortName\":\"liveViewCount\"}";
       return PostUtil.httpPostBody(url,json);
    }


    private static String liveList() throws IOException {

        String url=api+"/api/back/liveList";
        String json="{\"pageNo\":1,\n" +
                " \"pageSize\":20,\"sortName\":\"liveViewCount\"}";
        return PostUtil.httpPostBody(url,json);
    }


}
